﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title>宾果高校</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../css/bootstrap-datetimepicker.min.css" />
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/sweetalert.min.css" />
    <script src="../js/jquery-1.12.2.min.js"></script>
    <script src="../js/validator.min.js"></script>
    <script src="../js/common.js"></script>
    <script src="../js/bootstrap-datetimepicker.js"></script>
    <script src="../js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="../js/sweetalert.min.js"></script>
</head>
<body id="bodyContent">
    <div id="searchPage"></div>
    <div class="main">
        <div class="wrap">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="form-wrap">
                        <form id="formValidate" action="" class="form-horizontal">
                            <div class="form-group">
                                <label for="">活动名称</label>
                                <input type="text" data-error="请填写活动名称" required id="ProjectName" class="form-control">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <!--<div class="checkbox">-->
                                <label for="" class="checkbox-inline">活动类型：</label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="Nature" value="900000041" tag="文艺类"><span>文艺类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="Nature" value="900000042" tag="表演类"><span>表演类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="Nature" value="900000043" tag="晚会类"><span>晚会类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="Nature" value="900000044" tag="体育类"><span>体育类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="Nature" value="900000045" tag="讲座类"><span>讲座类</span>
                                </label>
                                <label class="checkbox-inline">
                                    <input type="checkbox" name="Nature" value="900000047" tag="其它"><span>其它</span>
                                </label>
                                <!--</div>-->
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label for="">活动时间:</label>
                                <input type="text" id="StartTime" style="display: inline-block; width: 110px;" placeholder="" data-error="请填写时间" required class="form-control input-sm datepick"><span> -</span>
                                <input type="text" id="EndTime" style="display: inline-block; width: 110px;" placeholder="" data-error="请填写时间" required class="form-control input-sm datepick">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label for="">活动场次</label>
                                <input type="text" data-error="请填写活动场次" id="ActivityAmount" required class="form-control">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label for="" class="radio-inline">活动涉及学生总数（人）:</label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000003" tag="0-100"><span>0-100</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000004" tag="101-300"><span>101-300</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000005" tag="301-500"><span>301-500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000006" tag="501-1000"><span>501-1000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000007" tag="1001-1500"><span>1001-1500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000008" tag="1501-2500"><span>1501-2500</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000009" tag="2501-3000"><span>2501-3000</span>
                                </label>
                                <label for="" class="radio-inline">
                                    <input type="radio" name="Entrants" value="900000010" tag="3000以上"><span>3000以上</span>
                                </label>
                            </div>
                            <div class="form-group">
                                <label for="">活动所需金额</label>
                                <select id="Money" class="form-control" data-error="请选择活动所需金额" required min="1">
                                    <option value="" selected="selected">请选择活动所需金额</option>
                                    <option value="900000011">500-2500</option>
                                    <option value="900000012">2501-5000</option>
                                    <option value="900000013">5001-7500</option>
                                    <option value="900000014">7501-10000</option>
                                    <option value="900000015">10001-15000</option>
                                    <option value="900000016">15001-20000</option>
                                    <option value="900000017">20001-25000</option>
                                    <option value="900000018">25001-30000</option>
                                    <option value="900000019">30001-50000</option>
                                    <option value="900000020">50001-70000</option>
                                    <option value="900000021">70001-100000</option>
                                    <option value="900000022">100001-150000</option>
                                    <option value="900000023">150001-200000</option>
                                    <option value="900000024">200000以上</option>
                                </select>
                                <!--<input type="number" data-error="请填写活动所需金额" id="Money" required class="form-control">-->
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label for="">所属社团</label>
                                <select id="BelongNO" class="form-control" data-error="请选择所属社团" required min="1">
                                    <option value="" selected="selected">请选择所属社团</option>
                                </select>
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                                <label for="">活动所需物资：活动海报（A2，A3，A4）</label>
                                <input type="number" id="900000067" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">活动展架</label>
                                <input type="number" id="900000066" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">横幅</label>
                                <input type="number" id="900000069" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">传单(黑白，彩色)</label>
                                <input type="number" id="900000070" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">KT板</label>
                                <input type="number" id="900000071" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">幕布</label>
                                <input type="number" id="900000072" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">易拉宝</label>
                                <input type="number" id="900000073" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">推头</label>
                                <input type="number" id="900000074" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">灯布</label>
                                <input type="number" id="900000075" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">木构</label>
                                <input type="number" id="900000076" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">展位</label>
                                <input type="number" id="900000077" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">灯箱</label>
                                <input type="number" id="900000078" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">桁架</label>
                                <input type="number" id="900000079" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">麦克风(耳麦，手麦，麦架)</label>
                                <input type="number" id="900000080" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">帐篷</label>
                                <input type="number" id="900000081" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">桌椅</label>
                                <input type="number" id="900000082" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">音箱</label>
                                <input type="number" id="900000083" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">其他</label>
                                <input type="number" id="900000086" class="form-control">
                            </div>
                            <div class="form-group">
                                <label for="">活动紧急联系人和电话</label>
                                <input type="text" data-error="请填写活动紧急联系人和电话" required id="UrgentRemark" class="form-control">
                                <div class="help-block with-errors"></div>
                            </div>
                            <div class="form-group">
                            <label for="">活动简介</label>
                                <input type="text" data-error="请填写活动简介" required id="ProjectRequire" class="form-control">
                            <div class="help-block with-errors"></div>
                    </div>
                    <div class="form-group text-center">
                        <button type="button" id="btnNext" class="btn btn-default" onclick="Go()">下一步</button>
                    </div>
                    </form>
                </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script>

    $("#searchPage").load("header.html", function () {
        SetCss("Pub");
    });

    $(function () {
        $('.datepick').datetimepicker({
            format: 'yyyy-mm-dd',
            language: 'zh-CN',
            minView: 2
        });
    });

    //一：需要已绑定或者创建社团。
    //二：就是他是否已经有提交过（正在审核中）或者（审核已通过处于发布中或者正在合同中）的社团活动书，
    //如果有的话，那么是不能再次发布的，提示只能同时又一份社团活动书在身。


    common.commonAjax({ type: 'Get', url: '../api/student/GetAssoc', sMethod: AfteAjax });

    function AfteAjax(ctx) {

        if (ctx == "" || ctx == null) {
            window.location = "../login.html";
            return;
        }

        var data = ctx.ResponseDict;
       
        if (data != null && data.message !=undefined) {
            common.alertMessage(data.message);
            $('#btnNext').hide();
            return;
        }

        for (var a in data)
            $("#BelongNO").append("<option value='" + a + "'>" + data[a] + "</option>")

    }

    function AfteAjax1(ctx) {

        if (ctx == "" || ctx == null) {
            window.location = "../login.html";
            return;
        }

        window.location = "publish2.aspx?id=" + ctx.ResponseStr;
    }

    function Go() {

        //$("#formValidate").validator({
        //    message: 'This value is not valid',
        //    fields: {
        //        LikedCount: {
        //            validators: {
        //                notEmpty: {
        //                    message: 'The gender is required'
        //                }
        //            }
        //        }
        //    }
        //})

        if (!common.validateForm())
            return;

        var values = common.GetCtrlValues({
            ContentID: "formValidate"
        })

        var TempArr = ""
        
        $("input:checkbox[name='Nature']:checked").each(function(){
            TempArr += $(this).attr("tag") + "$%#";
        });

        values["NatureName"] = TempArr;
        values["EntrantsName"] = $("input:radio[name='Entrants']:checked").attr("tag");
        values["MoneyName"] = $("#Money").find("option:selected").text();

        common.commonAjax({ type: 'Post', url: '../api/student/CreateProject', data: values, sMethod: AfteAjax1, alert: true, loadingCtrl: $("#bodyContent") });
    }

</script>